package com.demo.personalaccountingbackend.dto;

import com.demo.personalaccountingbackend.entity.Category;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 类描述信息
 *
 * @author zgx
 * @version 1.0
 * @date 2025/10/15 11:37
 */
@Data
public class RecordDTO {

    private Long id;
    private Integer type;           // 类型：0-支出，1-收入
    private BigDecimal amount;      // 金额
    private Long categoryId;        // 分类ID
    private String remark;          // 备注
    private LocalDate recordDate;   // 记录日期

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    // 关联的分类信息
    private Category category;

    // 构造方法
    public RecordDTO() {}
}
